package com.wasu.exception;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MessageException extends Exception{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private final Log logger = LogFactory.getLog(MessageException.class);
	private String msg;

	public MessageException(int msgCode, Throwable cause) {
		super();
		if (401 == msgCode) {
			this.msg = "未授权用户";
		} else if (1001 == msgCode) {
			this.msg = "对象异常";
		} 
		logger.error(">>>" + msgCode, cause);
	}

	@Override
	public String getMessage() {
		return msg;
	}

}
